<!DOCTYPE html>
<html>
<head>
<title>角色管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../include/resources.html">
<script type="text/javascript">
	var dataGrid;
	var winWidth =  500;
	var winHeight = 460;
	var addTitle = "添加角色";
	var addUrl =  "/modules/system/role/roleAddPage.html";
	var editTitle = "编辑角色";
	var editUrl =  "/modules/system/role/roleEditPage.html";
	var grantRoleMenuTitle = "授权管理";
	var grantRoleMenuUrl =  "/modules/system/role/roleEditMenuPage.html";
	var deleteUrl = "/modules/system/role/roleDelete.html";	

	$(function() {
		dataGrid = $('#dataGrid').datagrid({
			url : 'roleList.html',
			fit : true,
			fitColumns : true,
			border : false,
			pagination : true,
			idField : 'id',
			pageSize : pageSize,
			pageNums :1,
			pageList : pageList,
			sortName : 'id',
			sortOrder : 'asc',
			checkOnSelect : false,
			selectOnCheck : false,
			nowrap : false,
			singleSelect:true,
			columns : [ [ 			
			{ field: 'id', title: '编号', width: 50, fixed: true,checkbox : false},
			{ field: 'name', title: '角色名', width: 100,fixed:true, sortable:false },
			{ field: 'addUser', title: '添加者', width: 100, sortable:false },
			{ field: 'remark', title: '备注', width: 120, sortable:false }, 
			  {	field : 'action',
				title : '操作',
				width :100,
				fixed :true,
				formatter : function(value, row, index) {
					var str = '';
					str += '<dl>';
					str += '<dt><a href="javascript:void(0);">详情</a><i class="iconfont">&#xe639;</i></dt>' ;
					str += '<dd>';
					str += '<a href="javascript:void(0);" onclick="$.fn.dataGridOptions.editFun('+row.id+',editTitle,winWidth,winHeight,editUrl);" title="'+editTitle+'">编辑</a>';
					str += '<a href="javascript:void(0);" onclick="$.fn.dataGridOptions.grantFun('+row.id+',grantRoleMenuTitle,winWidth,winHeight,grantRoleMenuUrl);" title="'+grantRoleMenuTitle+'">授权</a>';
					str += '<a href="javascript:void(0);" onclick="$.fn.dataGridOptions.deleteFun('+row.id+',deleteUrl);">删除</a>';
					str += '</dd>'
					str +=  '</dl>'
					return str;
				}
			} ] ],
			toolbar : '#toolbar',
			
		});
	});
</script>
</head>
<body style="padding:0 20px;" >
	<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        	<div class="sLeft">
	            <form id="searchForm">
	            	<input type="text" name="name" autocomplete="off" class="sInput" placeholder="输入角色名进行搜索" autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a>
	            	<a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
            <div class="sRight">
				<a onclick="$.fn.dataGridOptions.addFun(-1,addTitle,winWidth,winHeight,addUrl);" href="javascript:void(0);" class="addBtn"><i class="iconfont">&#xe629;</i>添加</a>				
            </div>
		</div>
		<div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
			<table id="dataGrid"></table>
		</div>
	</div>
</body>
</html>
